"""
WordPress平台特定的文章数据模型
只包含发布文章到WordPress所必须的字段信息
"""

from typing import List, Dict, Any, Optional
from .article_data import ArticleData


class WordPressArticleData(ArticleData):
    """
    WordPress平台特定的文章数据模型
    继承自ArticleData，添加WordPress特定的字段
    """
    
    def __init__(self, title: str = "", content: str = "", url: str = "", 
                 status: str = 'publish', category_id: int = 1, 
                 tags: List[str] = None, featured_media_id: Optional[int] = None, 
                 publish_date: Optional[str] = None):
        """
        初始化WordPress文章数据
        :param title: 文章标题
        :param content: 文章内容（HTML格式）
        :param url: 原始文章URL
        :param status: 文章状态：'draft', 'publish', 'future', 'private', etc.
        :param category_id: 分类ID
        :param tags: 标签列表
        :param featured_media_id: 特色图片ID
        :param publish_date: 定时发布时间，格式为ISO 8601字符串，如 '2023-12-31T23:59:59'
        """
        super().__init__(title, content, url)
        
        # WordPress特定字段
        self.status = status
        self.category_id = category_id
        self.tags = tags if tags is not None else []
        self.featured_media_id = featured_media_id
        self.publish_date = publish_date
        
        # 图片URL到本地路径的映射
        self.image_mapping = {}